﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using HA.ModFlow.Domain.DomainLayer;
namespace HA.ModFlow.Controls.Windows
{
    /// <summary>
    /// winManualAddBarrier.xaml 的交互逻辑
    /// </summary>
    public partial class winManualAddBarrier : Window
    {
        public winManualAddBarrier(HFBItem barrier,bool isBarrier)
        {
            InitializeComponent();
            this._barrier =(HFBItem) barrier.Clone();
            this._isBarrier = isBarrier;
            this.chkIsBarrier.IsChecked = this._isBarrier;
            this.txtHydraulic.IsEnabled = this._isBarrier;
            this.DataContext = this._barrier;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

        }
        HFBItem _barrier;

        public HFBItem Barrier
        {
            get { return _barrier; }
            set { _barrier = value; }
        }
        bool _isBarrier = false;
        /// <summary>
        /// 是否添加屏障标志
        /// </summary>
        public bool IsBarrier
        {
            get { return _isBarrier; }
            set { _isBarrier = value; }
        }
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

        private void btnCancal_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void chkIsBarrier_Click(object sender, RoutedEventArgs e)
        {
            this._isBarrier = this.chkIsBarrier.IsChecked.Value ;
            this.txtHydraulic.IsEnabled = this.chkIsBarrier.IsChecked.Value;
        }
    }
}
